<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>学生选课系统 - 课程中心</title>
  <script src="https://cdn.tailwindcss.com"></script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
  <link rel="stylesheet" href="../css/selectcourscentere.css">
</head>
<body class="bg-gray-50 font-sans">
  <!-- 顶部导航栏 -->
  <header class="bg-white shadow-md fixed w-full z-50 transition-all duration-300" id="navbar">
    <div class="container mx-auto px-4 py-3 flex items-center justify-between">
      <div class="flex items-center space-x-2">
        <i class="fa-solid fa-graduation-cap text-blue-600 text-2xl"></i>
        <h1 class="text-xl font-bold text-gray-800">学生选课系统</h1>
      </div>
      
      <nav class="hidden md:flex items-center space-x-6">
        <a href="../html/home.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">首页</a>
        <a href="../html/selectcoursecenter.html" class="text-blue-600 font-medium hover:text-blue-800 transition-colors">选课</a>
        <a href="../html/coursetable.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">课程表</a>
          <a href="../html/gradesselect.html" class="text-gray-600 font-medium hover:text-blue-800 transition-colors">成绩查询</a>
        
      </nav>
      
      <div class="flex items-center space-x-4">
        <div class="relative">
          <button class="flex items-center space-x-2 focus:outline-none" id="userMenuBtn">
            <img src="https://picsum.photos/id/1005/40/40" alt="用户头像" class="w-8 h-8 rounded-full
            object-cover border-2 border-blue-500">
            <span class="hidden md:inline-block text-gray-700 font-medium">张三</span>
            <i class="fa-solid fa-angle-down text-gray-500"></i>
          </button>
          
          <!-- 用户下拉菜单 -->
          <div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 hidden z-50" id="userMenu">
            <a href="../html/personalcenter.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
              <i class="fa-solid fa-user mr-2"></i>个人中心
            </a>
            <a href="../html/accountsetting.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
              <i class="fa-solid fa-cog mr-2"></i>账号设置
            </a>
            <div class="border-t border-gray-100 my-1"></div>
            <a href="../html/login.html" class="block px-4 py-2 text-sm text-red-600 hover:bg-gray-100">
              <i class="fa-solid fa-sign-out-alt mr-2"></i>退出登录
            </a>
          </div>
        </div>
        
        <button class="md:hidden focus:outline-none" id="mobileMenuBtn">
          <i class="fa-solid fa-bars text-gray-700 text-xl"></i>
        </button>
      </div>
    </div>
    
    <!-- 移动端菜单 -->
    <div class="md:hidden bg-white border-t border-gray-100 hidden" id="mobileMenu">
      <div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
        <a href="../html/home.html" class="block px-3 py-2 rounded-md text-base font-medium text-gray-600 hover:text-blue-600 hover:bg-blue-50">首页</a>
        <a href="../html/selectcoursecenter.html" class="block px-3 py-2 rounded-md text-base font-medium text-blue-600 bg-blue-50">选课</a>
        <a href="../html/coursetable.html" class="block px-3 py-2 rounded-md text-base font-medium text-gray-600 hover:text-blue-600 hover:bg-blue-50">课程表</a>
        
      </div>
    </div>
  </header>

  <!-- 主内容区 -->
  <main class="container mx-auto pt-24 pb-12 px-4 md:px-6">
    <div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
      <!-- 侧边栏 -->
      <aside class="lg:col-span-1">
        <div class="bg-white rounded-xl shadow-md overflow-hidden sticky top-24">
          <div class="bg-gradient-to-r from-blue-500 to-indigo-600 p-4">
            <div class="flex items-center space-x-4">
              <img src="../images/courseimages/user.jpg" alt="用户头像" class="w-16 h-16 rounded-full object-cover border-4 border-white shadow-lg">
              <div>
                <h2 class="text-white font-bold text-xl" id="name">张三</h2>
                <p class="text-blue-100 text-sm" id="college">计算机科学与技术学院</p>
                <p class="text-blue-100 text-sm" id="id">学号: 20230001</p>
              </div>
            </div>
          </div>
          
          <nav class="p-4">
            <ul class="space-y-1">
              <li>
                <a href="../html/personalcenter.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-user-circle w-6"></i>
                  <span>个人信息</span>
                </a>
              </li>
              <li>
                <a href="../html/selectcoursecenter.html" class="flex items-center p-3 text-blue-600 bg-blue-50 rounded-lg font-medium">
                  <i class="fa-solid fa-book w-6"></i>
                  <span>选课中心</span>
                </a>
              </li>
              <li>
                <a href="../html/coursetable.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-calendar-alt w-6"></i>
                  <span>课程表</span>
                </a>
              </li>
              <li>
                <a href="../html/courseevaluate.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-star w-6"></i>
                  <span>课程评价</span>
                </a>
              </li>
              <li>
                <a href="../html/gradesselect.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-graduation-cap w-6"></i>
                  <span>成绩查询</span>
                </a>
              </li>
              <li>
                <a href="../html/accountsetting.html" class="flex items-center p-3 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors">
                  <i class="fa-solid fa-cog w-6"></i>
                  <span>账号设置</span>
                </a>
              </li>
            </ul>
          </nav>
          
          <!-- 选课统计 -->
          <div class="p-4 border-t border-gray-200">
            <h3 class="text-lg font-semibold text-gray-900 mb-3">选课统计</h3>
            <div class="space-y-3">
              <div class="flex justify-between items-center">
                <span class="text-gray-600">已选课程</span>
                <span class="font-medium">3门</span>
              </div>
              <div class="flex justify-between items-center">
                <span class="text-gray-600">已获学分</span>
                <span class="font-medium">11.0</span>
              </div>
              <div class="flex justify-between items-center">
                <span class="text-gray-600">可选学分上限</span>
                <span class="font-medium">25.0</span>
              </div>
              <div class="w-full bg-gray-200 rounded-full h-2 mt-2">
                <div class="bg-blue-600 h-2 rounded-full" style="width: 44%"></div>
              </div>
              <div class="text-xs text-gray-500 text-right mt-1">
                已使用 44% 的学分额度
              </div>
            </div>
          </div>
        </div>
      </aside>
      
      <!-- 主内容 -->
      <div class="lg:col-span-3 space-y-6">
        <!-- 选课提示 -->
        <div class="bg-blue-50 border-l-4 border-blue-500 p-4 rounded-r-lg">
          <div class="flex">
            <div class="flex-shrink-0">
              <i class="fa-solid fa-info-circle text-blue-500"></i>
            </div>
            <div class="ml-3">
              <p class="text-sm text-blue-700">
                当前为2023-2024学年第一学期选课阶段，选课时间：2023-09-01至2023-09-15。
                本学期可选学分上限为25学分，请合理安排选课计划。
              </p>
            </div>
          </div>
        </div>

        <!-- 筛选工具栏 -->
        <div class="bg-white rounded-xl shadow-md p-4">
          <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
            <div>
              <label class="block text-sm font-medium text-gray-700 mb-1">课程类型</label>
              <select id="classTypes" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                <option value="">全部类型</option>
                <option value="专业必修课">专业必修课</option>
                <option value="专业选修课">专业选修课</option>
                <option value="公共必修课">公共必修课</option>
                <option value="通识课">通识课</option>
              </select>
            </div>
            
            <div>
              <label class="block text-sm font-medium text-gray-700 mb-1">开课学院</label>
              <select id="academys" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                <option value="">全部学院</option>
                <option value="computer">计算机学院</option>
                <option value="math">数学学院</option>
                <option value="physics">物理学院</option>
                <option value="english">外国语学院</option>
              </select>
            </div>
            
            <div>
              <label class="block text-sm font-medium text-gray-700 mb-1">上课时间</label>
              <select id="times" class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                <option value="">全部时间</option>
                <option value="morning">上午</option>
                <option value="afternoon">下午</option>
                <option value="evening">晚上</option>
              </select>
            </div>
          </div>
          
          <div class="mt-4 flex flex-col sm:flex-row sm:items-center sm:justify-between">
            <div class="relative w-full sm:w-64">
              <input type="text" placeholder="搜索课程名称、教师..." class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
              <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                <i class="fa-solid fa-search text-gray-400"></i>
              </div>
            </div>
            
            <div class="mt-3 sm:mt-0 flex items-center space-x-2">
<!--              <button class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg transition-colors flex items-center">-->
<!--                <i class="fa-solid fa-sliders mr-1"></i> 更多筛选-->
<!--              </button>-->
              <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg
              transition-colors flex items-center"
              id="selectButton"
              >
               确定
              </button>
            </div>
          </div>
        </div>
        
        <!-- 课程列表 -->
        <div class="space-y-4">
          <!-- 课程卡片 -->
          <div class="bg-white rounded-xl shadow-md overflow-hidden transform hover:shadow-lg transition-all
          duration-300 card-hover" >
            <div class="p-6">
              <div class="flex flex-col md:flex-row md:items-start">
                <div class="md:w-2/3">
                  <div class="flex items-start justify-between">
<!--                    <h3 class="text-lg font-bold text-gray-900">学术英语</h3>-->
<!--                    课程名称-->
                    <h3 class="text-lg font-bold text-gray-900" id="className"></h3>

<!--                    <span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded">-->
<!--                      公共课-->
<!--                    </span>-->
<!--                    课程类型-->
                    <span class="bg-green-100 text-green-800 text-xs font-medium px-2.5 py-0.5 rounded" id="classType">

                    </span>
                  </div>
                  <div class="mt-2 flex flex-wrap items-center text-sm text-gray-600">
                    <div class="flex items-center mr-4 mb-1">
                      <i class="fa-solid fa-chalkboard-teacher mr-1"></i>
<!--                      <span>林七</span>-->
                      <span id="teacherName"></span>

                    </div>
                    <div class="flex items-center mr-4 mb-1">
                      <i class="fa-solid fa-graduation-cap mr-1"></i>
<!--                      <span>外国语学院</span>-->
<!--                      学院-->
                      <span id="academy"></span>

                    </div>
                    <div class="flex items-center mr-4 mb-1">
                      <i class="fa-solid fa-book mr-1"></i>
<!--                      <span>3.0学分</span>-->
                      <span id="Credits"></span>

                    </div>
                    <div class="flex items-center mr-4 mb-1">
                      <i class="fa-solid fa-clock mr-1"></i>
<!--                      <span>周四 1-2节</span>-->
                      <span id="time"></span>

                    </div>
                    <div class="flex items-center mb-1">
                      <i class="fa-solid fa-map-marker-alt mr-1"></i>
<!--                      <span>教4-101</span>-->
                      <span id="address"></span>
                    </div>

                    <div class="mt-3">
                      <p class="text-sm text-gray-600 line-clamp-2" id="classContent">
<!--                        本课程系统介绍微积分的基本理论和方法，包括函数、极限、导数、积分等内容，以及它们在科学和工程中的应用。-->
                      </p>
                    </div>




                  </div>
                  <div class="mt-4 flex items-center">
                    <div class="flex items-center mr-4">
                    </div>
                  </div>
                </div>
                <div class="mt-4 md:mt-0 md:w-1/3 md:pl-6 md:border-l md:border-gray-200 flex flex-col items-center md:items-end">
                  <div class="w-full mb-3">
                    <div class="flex justify-between text-sm mb-1">
                    </div>
                    <div class="w-full bg-gray-0 rounded-full h-2">
                    </div>
                  </div>
                  <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors flex items-center select-course-btn">
                    <i class="fa-solid fa-plus mr-1"></i> 选课
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 分页 -->
        <div class="flex justify-between items-center mt-8">
<!--          <div class="text-sm text-gray-500">-->
<!--            显示 1-4 条，共 24 条-->
<!--          </div>-->
<!--          -->
<!--          <div class="flex space-x-1">-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-500 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed" disabled>-->
<!--              <i class="fa-solid fa-angle-left"></i>-->
<!--            </button>-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg bg-blue-600 text-white">1</button>-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50">2</button>-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50">3</button>-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-700 hover:bg-gray-50">4</button>-->
<!--            <button class="w-10 h-10 flex items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-500 hover:bg-gray-50">-->
<!--              <i class="fa-solid fa-angle-right"></i>-->
<!--            </button>-->
<!--          </div>-->
        </div>
      </div>
    </div>
  </main>

  <!-- 页脚 -->
  <footer class="bg-gray-800 text-white py-12">
    <div class="container mx-auto px-4 md:px-6">
      <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
        <div>
          <h3 class="text-lg font-bold mb-4">学生选课系统</h3>
          <p class="text-gray-400 text-sm">为学生提供便捷的选课服务和个人信息管理</p>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">快速链接</h3>
          <ul class="space-y-2 text-sm">
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">选课中心</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">课程表</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">成绩查询</a></li>
          </ul>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">帮助支持</h3>
          <ul class="space-y-2 text-sm">
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
            <li><a href="#" class="text-gray-400 hover:text-white transition-colors">意见反馈</a></li>
          </ul>
        </div>
        
        <div>
          <h3 class="text-lg font-bold mb-4">联系我们</h3>
          <ul class="space-y-2 text-sm">
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-envelope mr-2"></i>
              <span>support@example.com</span>
            </li>
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-phone mr-2"></i>
              <span>010-12345678</span>
            </li>
            <li class="flex items-center text-gray-400">
              <i class="fa-solid fa-map-marker-alt mr-2"></i>
              <span>博雅甲512</span>
            </li>
          </ul>
        </div>
      </div>
      
      <div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400 text-sm">
        <p>© 2023 学生选课系统 版权所有</p>
      </div>
    </div>
  </footer>

  <!-- 选课确认模态框 -->
  <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="confirmModal">
    <div class="bg-white rounded-xl shadow-xl max-w-md w-full p-6 transform transition-all">
      <div class="text-center">
        <div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-blue-100 mb-4">
          <i class="fa-solid fa-question text-blue-500 text-2xl"></i>
        </div>
        <h3 class="text-lg font-medium text-gray-900 mb-2">确认选课</h3>
        <p class="text-sm text-gray-500 mb-4" id="confirmCourseName">您确定要选择《数据结构》这门课程吗？</p>
        <div class="flex justify-center space-x-3">
          <button class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors" id="cancelSelectBtn">
            取消
          </button>
          <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors" id="confirmSelectBtn">
            确认
          </button>
        </div>
      </div>
    </div>
  </div>

  <!-- 选课成功模态框 -->
  <div class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden" id="successSelectModal">
    <div class="bg-white rounded-xl shadow-xl max-w-md w-full p-6 transform transition-all">
      <div class="text-center">
        <div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-4">
          <i class="fa-solid fa-check text-green-500 text-2xl"></i>
        </div>
        <h3 class="text-lg font-medium text-gray-900 mb-2">选课成功</h3>
        <p class="text-sm text-gray-500 mb-6" id="successCourseName">您已成功选择《数据结构》这门课程。</p>
        <div class="flex justify-center">
          <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors" id="closeSuccessSelectBtn">
            确定
          </button>
        </div>
      </div>
    </div>
  </div>

  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="../js/selectcoursecenter.js"></script>
</body>
</html>
    